package com.fandou.airobot.domain.request;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;

import com.fandou.airobot.data.repository.DataRepository;
import com.fandou.airobot.database.Record;

import java.util.List;

/**
 * @author Jm
 * @date 2020/7/9 17:07
 * @description
 */
public class RecordingHistoryRequest  implements Request.IRecordHistoryRequest{

    private MutableLiveData<List<Record>> historyLiveData;


    @Override
    public LiveData<List<Record>> getRecordingHistoryLiveData() {
        if (historyLiveData == null) {
            historyLiveData = new MutableLiveData<>();
        }
        return historyLiveData;
    }

    @Override
    public void requestRecordingHistory() {
        DataRepository.getInstance().getRecordHistoryList(historyLiveData);
    }
}
